package com.exam.dao;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface OrderDao {

    @Select(" select a.id, a.product_name, order_price, DATE_FORMAT(a.order_time,'%Y-%m-%d %H:%i:%s') order_time\n" +
            "          from t_order_info a\n" +
            "         where a.order_status > 1\n" +
            "           and a.openid = #{openId}\n" +
            "      order by a.order_time desc")
    public Page<Map<String, Object>> getOrderListByOpenId(@Param("openId") String openId);
}
